/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import { Badge } from 'antd';
import React from 'react';
import { CheckOptions, useCheck } from './_utils/check';

interface RedPointProps {}

const RedPoint: React.FC<RedPointProps & CheckOptions> = (props) => {
  const { children, ...rest } = props;

  const [hasDot] = useCheck(rest);

  if (!hasDot) return <>{children}</>;

  return (
    <>
      {children}
      <Badge dot />
    </>
  );
};

export default RedPoint;
